package com.hashnode.cloudservice;

import com.hashnode.cloudservice.imp.PaymentServiceImpl;
import com.hashnode.model.CommonResult;
import com.hashnode.model.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//带@FeignClient注解的业务接口,使用 fallback 方式是无法获取异常信息的，如果想要获取异常信息，可以使用 fallbackFactory参数
@FeignClient(value = "nacos-payment-provider",fallback = PaymentServiceImpl.class)
public interface PaymentService {
    @GetMapping(value = "/payment/get/{id}")//向"/payment/get/{id}"发送请求,并封装结果,兜底方案对应PaymentServiceImpl实现类的同名方法
    public CommonResult<Payment> paymentSQL(@PathVariable("id")Long id);
}
